// todox: refactor to follow LESS and inner class convention
.ipModuleRepositoryPopup {
    background-color: #fff;
    height: 100%;
    left: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: (@zindex-modal + 10); // on top of everything

    .close {
        margin: (@grid-gutter-width / 4) (@grid-gutter-width / 4) 0 0;
    }

    .nav-tabs {
        padding: (@grid-gutter-width / 4) (@grid-gutter-width / 2) 0;
    }

    ._tabUpload {
        overflow: hidden;

        ._upload {
            background-color: @color-silver3;
            float: left;
            min-height: (@grid-gutter-width * 7.5);
            overflow-x: hidden;
            overflow-y: auto;
            padding: 20px;
            width: (@grid-gutter-width * 7);

            @media (max-width: @screen-xs-max) {
                width: (@grid-gutter-width * 3);
            }

            ._browseButtonWrapper {
                padding: @grid-gutter-width 0;
                text-align: center;
            }
            ._label {
                display: block;
                margin-bottom: (@grid-gutter-width / 4);
            }
            ._dragdropNotice {
                display: none;
            }

            &.dragdrop {
                background-image: url(); // source: bg_upload.png

                &.hover {
                    background-color: @color-silver-light;
                }
                ._dragdropNotice {
                    display: block;
                }
            }
        }

        ._browser {
            margin-left: (@grid-gutter-width * 8);
            min-height: (@grid-gutter-width * 7.5);
            overflow-x: hidden;
            overflow-y: auto;

            @media (max-width: @screen-xs-max) {
                margin-left: (@grid-gutter-width * 4);
            }

            ._browserControls {
                background-color: @color-silver3;
                margin-right: (@grid-gutter-width / 2); // for scrollbar
                padding: (@grid-gutter-width / 8) (@grid-gutter-width / 4);
                position: absolute;
                right: 0;
                top: 0;
                z-index: @zindex-navbar-fixed;

                ._search {
                    ._form {
                        width: (@grid-gutter-width * 8);

                        @media (max-width: @screen-xs-max) {
                            width: (@grid-gutter-width * 4);
                        }
                    }
                }
            }

            ._browserContainer {
                padding-bottom: (@grid-gutter-width * 1.5); // space for action buttons

                ._listTitle {
                    background: url() no-repeat; // source: icon_clock.png
                    clear: both;
                    color: #2f313f;
                    font-size: 14px;
                    font-weight: normal;
                    line-height: 21px;
                    margin-top: 15px;
                    padding-left: 30px;
                }
                ._recentTitle {
                    background: none;
                    font-weight: bold;
                    padding-left: 0;
                }
                ._list {
                    clear: both;
                    font-size: 14px;
                    list-style: none;
                    // making elements non-selectable
                    -webkit-touch-callout: none;
                    .user-select(none);

                    li {
                        cursor: pointer;
                        position: relative;

                        &:after {
                            content: '\f14a';
                            display: none;
                            font-family: 'FontAwesome';
                            font-size: 20px;
                            line-height: 20px;
                            position: absolute;
                        }
                        &:hover {
                            color: #000;
                        }

                        &.ui-selected,
                        &.ui-selected:hover {
                            color: @color-blue;
                            font-weight: bold;
                        }
                        &.ui-selected:after,
                        &.ui-selected:hover:after {
                            font-weight: normal;
                        }
                    }
                    &._previewType-list {
                        li {
                            border-bottom: 1px solid #e4e4e4;
                            margin-left: @grid-gutter-width;
                            margin-right: @grid-gutter-width;
                            padding: 10px 2px;

                            &:after {
                                left: 0;
                                margin: -10px 0 0 -@grid-gutter-width;
                                top: 50%;
                            }
                            .@{fa-css-prefix} {
                                display: inline-block;
                                min-width: 25px;
                            }
                        }
                    }
                    &._previewType-thumbnails {
                        margin: 0 0 (@grid-gutter-width / 2) -((@grid-gutter-width / 4) - 1); // leaving 1px for selected outline

                        li {
                            float: left;
                            margin: (@grid-gutter-width / 4) 0 0 (@grid-gutter-width / 4);

                            &:after {
                                font-size: 36px;
                                left: 50%;
                                margin: -16px 0 0 -16px;
                                text-shadow: -2px 0 rgba(255,255,255,0.8), 0 2px rgba(255,255,255,0.8), 2px 0 rgba(255,255,255,0.8), 0 -2px rgba(255,255,255,0.8);
                                top: 50%;
                            }
                            img {
                                border: 1px solid @color-silver2;
                                display: block;
                                height: @repository-thumb-height;
                                width: @repository-thumb-width;
                            }
                            &.ui-selected img {
                                border-color: @color-blue;
                                outline: @color-blue solid 1px;
                            }
                        }
                    }
                    &._previewType-thumbnails li .@{fa-css-prefix},
                    &._previewType-thumbnails li span,
                    &._previewType-list li img {
                        display: none; // hiding irrelevant elements
                    }
                }
                &.ui-selecting ._list li:after,
                ._list li:hover:after {
                    display: block;
                }
            }
        }

        ._repositoryActions {
            bottom: 0;
            left: 0;
            position: fixed;
            width: 100%;

            ._container {
                background-color: #fff;
                border: 3px solid @color-blue;
                margin: 0 (@grid-gutter-width / 2) 0 (@grid-gutter-width * 7); // left for ._upload; right for scrollbar
                padding: (@grid-gutter-width / 4) (@grid-gutter-width / 2);
                position: relative;
                text-align: center;

                @media (max-width: @screen-xs-max) {
                    margin: 0;
                }
            }
            ._title {
                color: @color-silver-dark3;
                display: inline-block;
                font-size: 14px;
                left: 20px;
                line-height: 26px; // keeping same baseline for text; absolute removes element from flow
                position: absolute; // to make buttons centered
            }
            .btn {
                margin-right: (@grid-gutter-width / 2);
            }
        }
    }

    ._tabBuy {
        position: relative;

        ._container iframe {
            overflow: hidden;
            width: 100%;
        }
        ._loading {
            background: #fff;
            height: 100%;
            left: 0;
            position: absolute;
            top: 0;
            width: 100%;
        }
        ._loadingText {
            background: url() no-repeat center top; // source: loading.gif
            display: block;
            left: 50%;
            margin: -30px 0 0 -(@grid-gutter-width * 4);
            padding-top: 20px;
            position: absolute;
            text-align: center;
            top: 50%;
            width: (@grid-gutter-width * 8);
        }
    }
}
